package com.zyx.file;

import java.io.File;
import java.io.FilenameFilter;

public class TestMyFile2 {
    public static void main(String[] args) {
        File file = new File("F:\\项目组\\javaWeb\\day1023");
        String[] fileList=file.list(new FilenameFilter(){
            @Override
            public boolean accept(File dir, String name) {
                if(name.endsWith(".txt")){
                    return true;
                }else{
                    return false;
                }
            }
        });
        for (String sf:fileList
             ) {
            System.out.println(sf);
        }
    }
}
